package com.jintian.smart.oa.mapper;

import com.jintian.smart.kernel.orm.mapper.IBaseExtMapper;
import com.jintian.smart.base.api.oa.entity.InvoiceEntity;
import com.jintian.smart.base.api.oa.form.InvoiceQueryForm;
import com.jintian.smart.base.api.oa.view.InvoiceVO;
import org.beetl.sql.core.page.PageResult;
import org.beetl.sql.mapper.annotation.Mapper;
import org.beetl.sql.mapper.annotation.Param;
import org.beetl.sql.mapper.annotation.SqlResource;

/**
 * OA发票信息
 */
@Mapper
@SqlResource("oa.Invoice")
public interface InvoiceMapper extends IBaseExtMapper<InvoiceEntity> {

    /**
     * 根据账号查询
     *
     * @param enterpriseId
     * @param accountNumber
     * @param excludeInvoiceId
     * @param deletedFlag
     * @return
     */
    InvoiceEntity queryByAccountNumber(@Param("enterpriseId") Long enterpriseId, @Param("accountNumber") String accountNumber, @Param("excludeInvoiceId") Long excludeInvoiceId, @Param("deletedFlag") Integer deletedFlag);

    /**
     * 删除发票信息
     *
     * @param invoiceId
     * @param deletedFlag
     */
    void deleteInvoice(@Param("invoiceId") Long invoiceId, @Param("deletedFlag") Boolean deletedFlag);

    /**
     * 发票信息分页查询
     *
     * @param queryForm
     * @return
     */
    PageResult<InvoiceVO> queryPage(@Param("queryForm") InvoiceQueryForm queryForm);

    /**
     * 查询发票信息详情
     *
     * @param invoiceId
     * @param deletedFlag
     * @return
     */
    InvoiceVO getDetail(@Param("invoiceId") Long invoiceId, @Param("deletedFlag") Boolean deletedFlag);
}
